import { NgModule } from '@angular/core';
import { SharedModule } from '@shared';
import { DelonFormModule, WidgetRegistry } from '@delon/form';
import { TinymceWidget } from '@shared/widgets-sf/tinymce/tinymce.widget';
import { UeditorWidget } from '@shared/widgets-sf/ueditor/ueditor.widget';
 import { DictSelectWidget } from '@shared/widgets-sf/dict-select/dict-select.widget';



export const SCHEMA_THIRDS_COMPONENTS = [
   TinymceWidget,
   UeditorWidget,
 DictSelectWidget,
];

@NgModule({
  declarations: SCHEMA_THIRDS_COMPONENTS,
  entryComponents: SCHEMA_THIRDS_COMPONENTS,
  imports: [SharedModule, DelonFormModule.forRoot()],
  exports: [...SCHEMA_THIRDS_COMPONENTS],
})
export class JsonSchemaModule {
  constructor(widgetRegistry: WidgetRegistry) {
     widgetRegistry.register(TinymceWidget.KEY, TinymceWidget);
     widgetRegistry.register(DictSelectWidget.KEY,DictSelectWidget)
     widgetRegistry.register(UeditorWidget.KEY, UeditorWidget);
  }
}
